# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Spanner.V1.Model.SplitPoints do
  @moduledoc """
  The split points of a table/index.

  ## Attributes

  *   `expireTime` (*type:* `DateTime.t`, *default:* `nil`) - Optional. The expiration timestamp of the split points. A timestamp in the past means immediate expiration. The maximum value can be 30 days in the future. Defaults to 10 days in the future if not specified.
  *   `index` (*type:* `String.t`, *default:* `nil`) - The index to split. If specified, the `table` field must refer to the index's base table.
  *   `keys` (*type:* `list(GoogleApi.Spanner.V1.Model.Key.t)`, *default:* `nil`) - Required. The list of split keys, i.e., the split boundaries.
  *   `table` (*type:* `String.t`, *default:* `nil`) - The table to split.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :expireTime => DateTime.t() | nil,
          :index => String.t() | nil,
          :keys => list(GoogleApi.Spanner.V1.Model.Key.t()) | nil,
          :table => String.t() | nil
        }

  field(:expireTime, as: DateTime)
  field(:index)
  field(:keys, as: GoogleApi.Spanner.V1.Model.Key, type: :list)
  field(:table)
end

defimpl Poison.Decoder, for: GoogleApi.Spanner.V1.Model.SplitPoints do
  def decode(value, options) do
    GoogleApi.Spanner.V1.Model.SplitPoints.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Spanner.V1.Model.SplitPoints do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
